<template>
  <div>
    <h1>demo</h1>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="id" label="id" width="55" />
      <el-table-column prop="date" label="日期" width="180" />
      <el-table-column prop="name" label="姓名" width="180" />
      <el-table-column prop="address" label="地址" />
      <el-table-column label="操作">
        <template #default="scope">
          <el-button type="primary" @click="handleJump(scope.row)">跳转</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const tableData = ref([
  {
    id: 1,
    date: '2016-05-02',
    name: '王小虎',
    address: '上海市普陀区金沙江路 1518 弄'
  },
  {
    id: 2,
    date: '2016-05-04',
    name: '王小虎',
    address: '上海市普陀区金沙江路 1518 弄'
  },
  {
    id: 3,
    date: '2016-05-01',
    name: '王小虎',
    address: '上海市普陀区金沙江路 1518 弄'
  }
])
function handleJump(row) {
  console.log(row.id)
  router.push({
    path: '/plus/jumpOne',
    query: {
      id: row.id
    }
  })
}
</script>

<style scoped>

</style>
